﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AddEdit.aspx.cs" Inherits="CardLogistics.Web.MainPage.CardArrival.StorageCheck.AddEdit" %>

<%@ Register Src="../../../Controls/WebUserControl_Nav.ascx" TagName="WebUserControl_Nav"
    TagPrefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>卡片验收入库_新增编辑</title>
    <link href="../../../css/style.css" rel="stylesheet" type="text/css" />
    <link href="../../../css/selPage.css" rel="stylesheet" type="text/css" />
    <script src="../../../js/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
    <script src="../../../js/valReq.js" type="text/javascript"></script>
    <script src="../../../js/jquery-1.3.2.min.js" type="text/javascript"></script>
    <script src="../../../js/jquery.tipswindow.2.0.js" type="text/javascript"></script>
    <script type="text/javascript" language="javascript">
        function valReq(issubmit) {
            //获取入库类型
            var dropDownList = document.getElementById("<%=ddlStorageType.ClientID %>");
            //获取DropDownList控件值
            var dropDownListValue = dropDownList.options[dropDownList.selectedIndex].value; //ID值
            var dropDownListText = dropDownList.options[dropDownList.selectedIndex].text; //显示值
            //非空校验
            var altStr = valid_isempty('CHECKNO', '入库单号');
            altStr += valid_isempty('ddlStorageType', '入库类型');
            //入库类型是“二次利用入库”时，不用选择订单，且不用验证入库明细是否重复
            if (dropDownListText != "二次利用入库" || dropDownListValue != "5DDA8F0A65AE4BDDA21A622EA6E1F257"
             || dropDownListText != "缺卡入库" || dropDownListValue != "AC537E666ADC46199AA742AAA5D43B2E")//5DDA8F0A65AE4BDDA21A622EA6E1F257是二次利用入库的ID值  AC537E666ADC46199AA742AAA5D43B2E 缺卡入库Id值
            {
                altStr += valid_isempty('OrderNo', '订单编号');
                altStr += valid_isnoCh('OrderNo', '订单编号');

                //校验卡片数量
                var dnum = parseInt($("#OrderNumber").val()); //订单总数
                var cnum = parseInt($("#putInTotal").val()); //已入库数量
                var bcnum = GetSumByName("DeservedNumber"); //本次入库数量
                var ednum = parseInt($("#hfEditSumCard").val()); //编辑时总数
                var ynum = dnum - cnum + ednum; //可入库数量=订单总数-已入库数量+编辑的数量
                if (bcnum > ynum) {
                    altStr += "当前入库数量" + bcnum + "不可大于" + ynum + ",请核对!";
                }
            }
            altStr += valid_isempty('STORAGEDATE', '入库日期');
            //非数字或字母校验
            altStr += valid_isnoCh('CHECKNO', '入库单号');

            altStr += GetCardInfo();
            altStr += valid_isempty('hf_CheckId', '入库明细');

            if (altStr != "") {
                alert(altStr);
                return false;
            }
            else {
                if (issubmit == 1) {
                    if (confirm("提交后该信息进入待审批状态不可编辑,确认提交吗?") == true) {
                        return true;
                    }
                    else
                        return false;
                }
                else
                    return true;
            }
        }

    </script>
    <script type="text/javascript">
        $(document).ready(function () {
            $("#OrderNo").click(function () { //选择订单
                $.tipsWindow({
                    ___title: "选择订单",
                    ___content: "iframe:../../SelectPage/SelOrder.aspx?type=sc",
                    ___width: "1000",
                    ___height: "500",
                    ___drag: "___boxTitle",
                    ___showbg: true
                });
            });

            //输入结束卡号时，自动计算实际数量
            $("input[name='EndNo']").keyup(function () {
                debugger;
                var endNO = this.value; //当前值-EndNO结束卡号
                var tr = this.parentNode.parentNode; //当前行
                var startNO = $(tr.cells[3]).find("input").val(); //起始卡号StartNO
                var ActualNumber = 0; //计算单个实际数量{
                if (startNO.toString().length ==8 && parseInt(endNO) >= parseInt(startNO)) {
                    ActualNumber = parseInt(endNO) - parseInt(startNO) + 1;
                    $(tr.cells[6]).find("input").val(ActualNumber); //实际数量赋值
                } else {
                    $(tr.cells[6]).find("input").val(0); //实际数量赋值
                    $(tr.cells[5]).find("input").val(0); //应有数量赋值
                }
            });
            //汇总实际数量
            $("input[name='ActualNumber']").keyup(function () {
                document.getElementById("ActualSum").innerHTML = GetSumByName("ActualNumber"); //实际数量合计
            });
            //根据开始卡号默认结束卡号（开始卡号+199，每盒200张），并计算应有数量
            $("#tb_Detail").keyup(function () {
                var DeservedNumber = $("input[name=DeservedNumber]"); //应有数量
                var ActualNumber = $("input[name=ActualNumber]"); //实际数量
                var StartNo = $("input[name=StartNo]"); //开始卡号
                var EndNo = $("input[name=EndNo]"); //结束卡号
                $("input[name='StartNo']").each(function (i, o) {
                    if ($(StartNo[i]).val().length == 8 && ($(EndNo[i]).val() == "" || $(EndNo[i]).val() == "0")) {
                   // if ($(StartNo[i]).val().length > 0 && ($(EndNo[i]).val() == "" || $(EndNo[i]).val() == "0")) {
                        $(EndNo[i]).val(parseInt(Trim($(StartNo[i]).val())) + 199); //给结束卡号赋值
                    }
                    if (Trim($(StartNo[i]).val()).length == 8 && Trim($(EndNo[i]).val()).length == 8 && parseInt(Trim($(EndNo[i]).val())) >= parseInt(Trim($(StartNo[i]).val()))) {
                    //if (Trim($(StartNo[i]).val()).length >= 0 && Trim($(EndNo[i]).val()).length >0 && parseInt(Trim($(EndNo[i]).val())) >= parseInt(Trim($(StartNo[i]).val()))) {
                        var yy = parseInt(Trim($(EndNo[i]).val())) - parseInt(Trim($(StartNo[i]).val())) + 1;
                        if ($(DeservedNumber[i]).val() == "" || $(DeservedNumber[i]).val() == "0") {
                            if ($(ActualNumber[i]).val() == "" || $(ActualNumber[i]).val() == "0") {
                                $(ActualNumber[i]).val(yy); //实际数量
                            }
                        }
                        $(DeservedNumber[i]).val(yy); //应有数量
                    } else {
                        $(DeservedNumber[i]).val(0); //应有数量
                        $(ActualNumber[i]).val(0); //实际数量
                    }
                });
                //合计
                GetSumInfo();
            });
        })
        //合计
        function GetSumInfo() {
            document.getElementById("DueSum").innerHTML = GetSumByName("DeservedNumber"); //应有数量合计
            document.getElementById("ActualSum").innerHTML = GetSumByName("ActualNumber"); //实际数量合计
        }
        //保存时获取明细数据
        function GetCardInfo() {
            var Data_value = [];
            var errInfo = ""; //返回错误消息
            var vIndex = 0;
            var BoxNo = $("input[name=BoxNo]"); //箱号
            var CardNo = $("input[name=CardNo]"); //盒号
            var StartNo = $("input[name=StartNo]"); //开始卡号
            var EndNo = $("input[name=EndNo]"); //结束卡号
            var DeservedNumber = $("input[name=DeservedNumber]"); //应有数量
            var ActualNumber = $("input[name=ActualNumber]"); //实际数量
            var MissingCardNo = $("input[name=MissingCardNo]"); //缺卡卡号
            $("input[name='BoxNo']").each(function (i, o) {
                if (($(BoxNo[i]).val() != "0" && $(BoxNo[i]).val() != "")) {
                    Data_value[vIndex] = "'" + Trim($(o).val()) + "'|'" + Trim($(CardNo[i]).val()) + "'|'" + Trim($(StartNo[i]).val())
                    + "'|'" + Trim($(EndNo[i]).val()) + "'|" + Trim($(DeservedNumber[i]).val()) + "|" + Trim($(ActualNumber[i]).val()) + "|" + "'" + Trim($(MissingCardNo[i]).val()) + "'"; //字段值
                    vIndex++;
                    if (Trim($(o).val()) == "" || ($(CardNo[i]).val() == "0" || ($(CardNo[i]).val() == "")) || ($(StartNo[i]).val() == "0" || ($(StartNo[i]).val() == "")) ||
                     ($(EndNo[i]).val() == "0" || ($(EndNo[i]).val() == "")) || ($(DeservedNumber[i]).val() == "0" || ($(DeservedNumber[i]).val() == "")) || ($(ActualNumber[i]).val() == "0" || ($(ActualNumber[i]).val() == ""))) {
                        errInfo += "第" + vIndex + "行明细不能为空\n";
                    }
                    //判断实际数量不能超过应有数量
                    if (parseInt(Trim($(ActualNumber[i]).val())) > parseInt(Trim($(DeservedNumber[i]).val()))) {
                        errInfo += "第" + vIndex + "行实际数量不能超过应有数量\n";
                    }
                }
            });
            $("#hf_CheckId").val(Data_value.join(";"));
            //合计
            document.getElementById("currTotal").value = GetSumByName("ActualNumber"); //实际数量合计
            return errInfo;
        }

        //修改时绑定明细数据
        function BindDetailInfo() {
            var BoxNo = $("input[name=BoxNo]");
            var CardNo = $("input[name=CardNo]");
            var StartNo = $("input[name=StartNo]");
            var EndNo = $("input[name=EndNo]");
            var DeservedNumber = $("input[name=DeservedNumber]");
            var ActualNumber = $("input[name=ActualNumber]");
            var MissingCardNo = $("input[name=MissingCardNo]");
            var ids = document.getElementById("hf_CheckId").value;
            var str1 = ids.split(";");
            for (var i = 0; i < str1.length; i++) {
                if (str1[i] != "") {
                    $(BoxNo[i]).val(str1[i].split("|")[0].replace("'", "").replace("'", "")); //箱号
                    $(CardNo[i]).val(str1[i].split("|")[1].replace("'", "").replace("'", "")); //盒号
                    $(StartNo[i]).val(Pad(str1[i].split("|")[2].replace("'", "").replace("'", ""), 8)); //开始卡号
                    $(EndNo[i]).val(Pad(str1[i].split("|")[3].replace("'", "").replace("'", ""), 8)); //结束卡号
                    $(DeservedNumber[i]).val(str1[i].split("|")[4]); //应有数量
                    $(ActualNumber[i]).val(str1[i].split("|")[5]); //实际数量
                    $(MissingCardNo[i]).val(str1[i].split("|")[6].replace("'", "").replace("'", "")); //缺卡卡号
                }
            }
            //合计
            GetSumInfo();
            document.getElementById("currTotal").value = GetSumByName("ActualNumber"); //实际数量合计
            document.getElementById("OrderNumber").value = document.getElementById("OrderNumber").value
        }
        window.onload = function () { BindDetailInfo(); }


        //验证是否选择了待上传文件
        function LoadFile() {
            var fstr = document.getElementById("FileUpload1").value;
            fstr.outerHTML = fstr.outerHTML;
            if (fstr == "") {
                alert("请选择您要上传的文件！");
                return false;
            }
            return true;
        }
    </script>
</head>
<body>
    <form id="frmStorageCheck" runat="server">
    <input type="hidden" id="hf_CheckId" runat="server" />
    <input type="hidden" id="OrderNumber" runat="server" />
    <input type="hidden" id="putInTotal" runat="server" />
    <input type="hidden" id="currTotal" runat="server" />
    <input type="hidden" id="hfEditSumCard" runat="server" />
    <uc1:WebUserControl_Nav ID="WebUserControl_Nav1" runat="server" />
    <%=TitleName %>
    <table class="theFormM" width="100%" border="0" cellspacing="0" cellpadding="0" style="line-height: 20px;">
        <tr>
            <td class="titleTxt">
                入库单号：
            </td>
            <td class="contentTxtM">
                <input id="CHECKNO" runat="server" type="text" class="dfinputNoEmp" readonly="readonly"
                    maxlength="25" />
            </td>
            <td class="titleTxt">
                入库类型：
            </td>
            <td class="contentTxtM">
                <asp:DropDownList ID="ddlStorageType" runat="server" class="dfinputNoEmp">
                </asp:DropDownList>
            </td>
            <td class="titleTxt">
                订单编号：
            </td>
            <td class="contentTxtM">
                <input id="OrderNo" runat="server" type="text" readonly="readonly" class="dfinputImg"
                    maxlength="25" />
                <asp:HiddenField ID="hf_OrderId" runat="server" />
            </td>
        </tr>
        <tr>
            <td class="titleTxt">
                入库日期：
            </td>
            <td class="contentTxtM">
                <input id="STORAGEDATE" runat="server" type="text" class="Wdate" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" />
            </td>
            <td class="titleTxt">
                卡片验收员：
            </td>
            <td class="contentTxtM">
                <input id="EXAMINER" runat="server" type="text" class="dfinput" maxlength="25" />
            </td>
            <td class="titleTxt">
            </td>
            <td class="contentTxtM">
            </td>
        </tr>
        <tr>
            <td class="titleTxt">
                备注：
            </td>
            <td colspan="5">
                <input id="REMARK" runat="server" type="text" maxlength="200" class="dfinput" style="width: 95%;" />
            </td>
        </tr>
        <tr>
            <td colspan="8" style="text-align: left; border: 1px;">
                <asp:FileUpload ID="FileUpload1" runat="server" CssClass="dfFile" Width="350px" />
                <asp:Button ID="btnImport" runat="server" Text="导入" CssClass="scbtn" OnClientClick="return LoadFile();"
                    OnClick="btnImport_Click" />
                <asp:Button ID="btnDownLoad" runat="server" Text="模板下载" CssClass="scbtn" OnClick="btnDownLoad_Click" />
            </td>
        </tr>
        <tr>
            <td colspan="8">
                <div class="ddetail">
                    <table class="tabledetail" id="tb_Detail">
                        <thead>
                            <tr>
                                <th width="70px">
                                    序号
                                </th>
                                <th width="110px">
                                    箱号
                                </th>
                                <th width="110px">
                                    盒号
                                </th>
                                <th width="110px">
                                    起始卡号
                                </th>
                                <th width="110px">
                                    结束卡号
                                </th>
                                <th width="110px">
                                    应有数量/张
                                </th>
                                <th width="110px">
                                    实际数量/张
                                </th>
                                <th>
                                    缺卡卡号
                                </th>
                                <th>
                                    &nbsp;
                                </th>
                            </tr>
                        </thead>
                        <tbody id="tablebody">
                            <tr>
                                <td width="70px" align="center">
                                    1
                                </td>
                                <td>
                                    <input name="BoxNo" type="text" class="dfinput" onkeydown="onlyNumCode();" maxlength="11" />
                                </td>
                                <td>
                                    <input name="CardNo" type="text" class="dfinput" onkeydown="onlyNumCode();" maxlength="11" />
                                </td>
                                <td>
                                    <input name="StartNo" type="text" class="dfinput" onkeydown="onlyNum();" maxlength="8" />
                                </td>
                                <td>
                                    <input name="EndNo" type="text" class="dfinput" onkeydown="onlyNum();" maxlength="8" />
                                </td>
                                <td>
                                    <input name="DeservedNumber" readonly="readonly" type="text" class="dfinput" value="0"
                                        onkeydown="onlyNum();" maxlength="9" />
                                </td>
                                <td>
                                    <input name="ActualNumber" type="text" class="dfinput" value="0" onkeydown="onlyNum();"
                                        maxlength="9" />
                                </td>
                                <td>
                                    <input name="MissingCardNo" onkeyup="onlyMisCard(this);" type="text" class="dfinput" />
                                </td>
                                <td>
                                    &nbsp;
                                </td>
                            </tr>
                            <tr>
                                <td width="70px" align="center">
                                    2
                                </td>
                                <td>
                                    <input name="BoxNo" type="text" class="dfinput" onkeydown="onlyNumCode();" maxlength="11" />
                                </td>
                                <td>
                                    <input name="CardNo" type="text" class="dfinput" onkeydown="onlyNumCode();" maxlength="11" />
                                </td>
                                <td>
                                    <input name="StartNo" type="text" class="dfinput" onkeydown="onlyNum();" maxlength="8" />
                                </td>
                                <td>
                                    <input name="EndNo" type="text" class="dfinput" onkeydown="onlyNum();" maxlength="8" />
                                </td>
                                <td>
                                    <input name="DeservedNumber" readonly="readonly" type="text" class="dfinput" value="0"
                                        onkeydown="onlyNum();" maxlength="9" />
                                </td>
                                <td>
                                    <input name="ActualNumber" type="text" class="dfinput" value="0" onkeydown="onlyNum();"
                                        maxlength="9" />
                                </td>
                                <td>
                                    <input name="MissingCardNo" onkeyup="onlyMisCard(this);" type="text" class="dfinput" />
                                </td>
                                <td>
                                    &nbsp;
                                </td>
                            </tr>
                            <tr>
                                <td width="70px" align="center">
                                    3
                                </td>
                                <td>
                                    <input name="BoxNo" type="text" class="dfinput" onkeydown="onlyNumCode();" maxlength="11" />
                                </td>
                                <td>
                                    <input name="CardNo" type="text" class="dfinput" onkeydown="onlyNumCode();" maxlength="11" />
                                </td>
                                <td>
                                    <input name="StartNo" type="text" class="dfinput" onkeydown="onlyNum();" maxlength="8" />
                                </td>
                                <td>
                                    <input name="EndNo" type="text" class="dfinput" onkeydown="onlyNum();" maxlength="8" />
                                </td>
                                <td>
                                    <input name="DeservedNumber" readonly="readonly" type="text" class="dfinput" value="0"
                                        onkeydown="onlyNum();" maxlength="9" />
                                </td>
                                <td>
                                    <input name="ActualNumber" type="text" class="dfinput" value="0" onkeydown="onlyNum();"
                                        maxlength="9" />
                                </td>
                                <td>
                                    <input name="MissingCardNo" onkeyup="onlyMisCard(this);" type="text" class="dfinput" />
                                </td>
                                <td>
                                    &nbsp;
                                </td>
                            </tr>
                            <tr>
                                <td width="70px" align="center">
                                    4
                                </td>
                                <td>
                                    <input name="BoxNo" type="text" class="dfinput" onkeydown="onlyNumCode();" maxlength="11" />
                                </td>
                                <td>
                                    <input name="CardNo" type="text" class="dfinput" onkeydown="onlyNumCode();" maxlength="11" />
                                </td>
                                <td>
                                    <input name="StartNo" type="text" class="dfinput" onkeydown="onlyNum();" maxlength="8" />
                                </td>
                                <td>
                                    <input name="EndNo" type="text" class="dfinput" onkeydown="onlyNum();" maxlength="8" />
                                </td>
                                <td>
                                    <input name="DeservedNumber" readonly="readonly" type="text" class="dfinput" value="0"
                                        onkeydown="onlyNum();" maxlength="9" />
                                </td>
                                <td>
                                    <input name="ActualNumber" type="text" class="dfinput" value="0" onkeydown="onlyNum();"
                                        maxlength="9" />
                                </td>
                                <td>
                                    <input name="MissingCardNo" onkeyup="onlyMisCard(this);" type="text" class="dfinput" />
                                </td>
                                <td>
                                    &nbsp;
                                </td>
                            </tr>
                            <tr>
                                <td width="70px" align="center">
                                    5
                                </td>
                                <td>
                                    <input name="BoxNo" type="text" class="dfinput" onkeydown="onlyNumCode();" maxlength="11" />
                                </td>
                                <td>
                                    <input name="CardNo" type="text" class="dfinput" onkeydown="onlyNumCode();" maxlength="11" />
                                </td>
                                <td>
                                    <input name="StartNo" type="text" class="dfinput" onkeydown="onlyNum();" maxlength="8" />
                                </td>
                                <td>
                                    <input name="EndNo" type="text" class="dfinput" onkeydown="onlyNum();" maxlength="8" />
                                </td>
                                <td>
                                    <input name="DeservedNumber" readonly="readonly" type="text" class="dfinput" value="0"
                                        onkeydown="onlyNum();" maxlength="9" />
                                </td>
                                <td>
                                    <input name="ActualNumber" type="text" class="dfinput" value="0" onkeydown="onlyNum();"
                                        maxlength="9" />
                                </td>
                                <td>
                                    <input name="MissingCardNo" onkeyup="onlyMisCard(this);" type="text" class="dfinput" />
                                </td>
                                <td>
                                    &nbsp;
                                </td>
                            </tr>
                            <tr>
                                <td width="70px" align="center">
                                    6
                                </td>
                                <td>
                                    <input name="BoxNo" type="text" class="dfinput" onkeydown="onlyNumCode();" maxlength="11" />
                                </td>
                                <td>
                                    <input name="CardNo" type="text" class="dfinput" onkeydown="onlyNumCode();" maxlength="11" />
                                </td>
                                <td>
                                    <input name="StartNo" type="text" class="dfinput" onkeydown="onlyNum();" maxlength="8" />
                                </td>
                                <td>
                                    <input name="EndNo" type="text" class="dfinput" onkeydown="onlyNum();" maxlength="8" />
                                </td>
                                <td>
                                    <input name="DeservedNumber" readonly="readonly" type="text" class="dfinput" value="0"
                                        onkeydown="onlyNum();" maxlength="9" />
                                </td>
                                <td>
                                    <input name="ActualNumber" type="text" class="dfinput" value="0" onkeydown="onlyNum();"
                                        maxlength="9" />
                                </td>
                                <td>
                                    <input name="MissingCardNo" onkeyup="onlyMisCard(this);" type="text" class="dfinput" />
                                </td>
                                <td>
                                    &nbsp;
                                </td>
                            </tr>
                            <tr>
                                <td width="70px" align="center">
                                    7
                                </td>
                                <td>
                                    <input name="BoxNo" type="text" class="dfinput" onkeydown="onlyNumCode();" maxlength="11" />
                                </td>
                                <td>
                                    <input name="CardNo" type="text" class="dfinput" onkeydown="onlyNumCode();" maxlength="11" />
                                </td>
                                <td>
                                    <input name="StartNo" type="text" class="dfinput" onkeydown="onlyNum();" maxlength="8" />
                                </td>
                                <td>
                                    <input name="EndNo" type="text" class="dfinput" onkeydown="onlyNum();" maxlength="8" />
                                </td>
                                <td>
                                    <input name="DeservedNumber" readonly="readonly" type="text" class="dfinput" value="0"
                                        onkeydown="onlyNum();" maxlength="9" />
                                </td>
                                <td>
                                    <input name="ActualNumber" type="text" class="dfinput" value="0" onkeydown="onlyNum();"
                                        maxlength="9" />
                                </td>
                                <td>
                                    <input name="MissingCardNo" onkeyup="onlyMisCard(this);" type="text" class="dfinput" />
                                </td>
                                <td>
                                    &nbsp;
                                </td>
                            </tr>
                            <tr>
                                <td width="70px" align="center">
                                    8
                                </td>
                                <td>
                                    <input name="BoxNo" type="text" class="dfinput" onkeydown="onlyNumCode();" maxlength="11" />
                                </td>
                                <td>
                                    <input name="CardNo" type="text" class="dfinput" onkeydown="onlyNumCode();" maxlength="11" />
                                </td>
                                <td>
                                    <input name="StartNo" type="text" class="dfinput" onkeydown="onlyNum();" maxlength="8" />
                                </td>
                                <td>
                                    <input name="EndNo" type="text" class="dfinput" onkeydown="onlyNum();" maxlength="8" />
                                </td>
                                <td>
                                    <input name="DeservedNumber" readonly="readonly" type="text" class="dfinput" value="0"
                                        onkeydown="onlyNum();" maxlength="9" />
                                </td>
                                <td>
                                    <input name="ActualNumber" type="text" class="dfinput" value="0" onkeydown="onlyNum();"
                                        maxlength="9" />
                                </td>
                                <td>
                                    <input name="MissingCardNo" onkeyup="onlyMisCard(this);" type="text" class="dfinput" />
                                </td>
                                <td>
                                    &nbsp;
                                </td>
                            </tr>
                            <tr>
                                <td width="70px" align="center">
                                    9
                                </td>
                                <td>
                                    <input name="BoxNo" type="text" class="dfinput" onkeydown="onlyNumCode();" maxlength="11" />
                                </td>
                                <td>
                                    <input name="CardNo" type="text" class="dfinput" onkeydown="onlyNumCode();" maxlength="11" />
                                </td>
                                <td>
                                    <input name="StartNo" type="text" class="dfinput" onkeydown="onlyNum();" maxlength="8" />
                                </td>
                                <td>
                                    <input name="EndNo" type="text" class="dfinput" onkeydown="onlyNum();" maxlength="8" />
                                </td>
                                <td>
                                    <input name="DeservedNumber" readonly="readonly" type="text" class="dfinput" value="0"
                                        onkeydown="onlyNum();" maxlength="9" />
                                </td>
                                <td>
                                    <input name="ActualNumber" type="text" class="dfinput" value="0" onkeydown="onlyNum();"
                                        maxlength="9" />
                                </td>
                                <td>
                                    <input name="MissingCardNo" onkeyup="onlyMisCard(this);" type="text" class="dfinput" />
                                </td>
                                <td>
                                    &nbsp;
                                </td>
                            </tr>
                            <tr>
                                <td width="70px" align="center">
                                    10
                                </td>
                                <td>
                                    <input name="BoxNo" type="text" class="dfinput" onkeydown="onlyNumCode();" maxlength="11" />
                                </td>
                                <td>
                                    <input name="CardNo" type="text" class="dfinput" onkeydown="onlyNumCode();" maxlength="11" />
                                </td>
                                <td>
                                    <input name="StartNo" type="text" class="dfinput" onkeydown="onlyNum();" maxlength="8" />
                                </td>
                                <td>
                                    <input name="EndNo" type="text" class="dfinput" onkeydown="onlyNum();" maxlength="8" />
                                </td>
                                <td>
                                    <input name="DeservedNumber" readonly="readonly" type="text" class="dfinput" value="0"
                                        onkeydown="onlyNum();" maxlength="9" />
                                </td>
                                <td>
                                    <input name="ActualNumber" type="text" class="dfinput" value="0" onkeydown="onlyNum();"
                                        maxlength="9" />
                                </td>
                                <td>
                                    <input name="MissingCardNo" onkeyup="onlyMisCard(this);" type="text" class="dfinput" />
                                </td>
                                <td>
                                    &nbsp;
                                </td>
                            </tr>
                            <%=AddTr.ToString() %>
                        </tbody>
                    </table>
                </div>
                <table class="tablesum">
                    <tr>
                        <th width="81px">
                            &nbsp;
                        </th>
                        <th width="111px" style="text-align: center;">
                            合计
                        </th>
                        <th width="111px">
                            &nbsp;
                        </th>
                        <th width="111px">
                            &nbsp;
                        </th>
                        <th width="111px">
                            &nbsp;
                        </th>
                        <th width="111px" style="text-align: right;" id="DueSum">
                            0
                        </th>
                        <th width="111px" style="text-align: right;" id="ActualSum">
                            0
                        </th>
                        <th>
                            &nbsp;
                        </th>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td colspan="8" align="center" style="height: 55px;">
                <asp:Button ID="btn_Submit" CssClass="btn" runat="server" Text="保存并提交" OnClientClick="return valReq(1);"
                    OnClick="btn_Submit_Click" />
                <asp:Button ID="btn_Add" CssClass="btn" runat="server" Text="保存" OnClientClick="return valReq(0);"
                    OnClick="btn_Add_Click" />
                <input type="button" class="btn" value="返回" onclick="javascript:history.go(-1);" />
            </td>
        </tr>
    </table>
    </form>
</body>
</html>
